import {createRouter, createWebHistory} from 'vue-router'
import IndexView from '@/views/IndexView.vue'
import LoginView from "@/views/LoginView.vue"
import InfoView from "@/views/InfoView";
import HomeView from "@/views/HomeView.vue";
import AudioView from "@/views/AudioView";
import EditUserInfo from "@/views/EditUserInfo";
import OpenVipView from "@/views/OpenVipView";
import VipRecordView from "@/views/VipRecordView";
import MyBookView from "@/views/MyBookView";
import CategoryView from "@/views/CategoryView";
import CateListView from "@/views/CateListView";
import LocationView from "@/views/LocationView";
import AddrView from "@/views/AddrView";
import AddrModification from "@/views/AddrModification";
import CollectView from "@/views/CollectView";
import OrderView from "@/views/OrderView";

const routes = [{
    path: '/', name: 'index', component: IndexView
}, {
    path: '/login', name: 'login', component: LoginView
}, {
    path: '/info', name: 'info', component: InfoView
}, {
    path: '/home', name: 'home', component: HomeView
}, {
    path: '/audio', name: 'audio', component: AudioView
}, {
    path: '/edit_user_info', name: 'edit_user_info', component: EditUserInfo
}, {
    path: '/open_vip', name: 'open_vip', component: OpenVipView
}, {
    path: '/vip_record', name: 'vip_record', component: VipRecordView
}, {
    path: '/my_book', name: 'my_book', component: MyBookView
}, {
    path: '/cate', name: 'cate', component: CategoryView
}, {
    path: '/cate_list', name: 'cate_list', component: CateListView
},{
    path: '/location', name: 'location', component: LocationView
},{
    path: '/addr', name: 'addr', component: AddrView
},{
    path: '/modification', name: 'modification', component: AddrModification
},{
    path: '/collect', name: 'collect', component: CollectView
},{
    path: '/order', name: 'order', component: OrderView
},]

const router = createRouter({
    routes, history: createWebHistory(process.env.BASE_URL), scrollBehavior() {
        return {top: 0}
    }
})

export default router
